﻿@using System.Collections
@using MvcApplication4.Models
@model IEnumerable<tb_Vacinacao>

@{
    ViewBag.Title = "Vacinas Aplicadas";
    //Layout = "~/Views/Shared/_Layout.cshtml";
}

<h2>Resultado da Pesquisa</h2>

    <h2>Vacinas Aplicadas</h2>
<br/>

    <div class="sample-panel-margin" style="width: 95%;">
    @{
        Html.Syncfusion().Grid<tb_Vacinacao>("IndexSearch")
            .Datasource(Model)
            .Caption("Vacinações Aplicadas")
            .EnablePaging()
            .EnableFiltering()
            .EnableSorting()
            .AutoFormat(Skins.Turquoise)
            .AllowResizing(true)
            .ToolBar(toolbar =>
            {
                toolbar.Add(GridToolBarItems.ExcelExport, "Excel")
                       .Add(GridToolBarItems.WordExport, "Word")
                       .Add(GridToolBarItems.PDFExport, "PDF");
            })
            .Mappers(map =>
            {
                map.ExportExcelAction("ExportToExcel")
                   .ExportWordAction("ExportToWord")
                   .ExportPdfAction("ExportToPDF");
            })
            .Column(cols =>
                {
                    cols.Add(c => c.ID_Vacinacao).HeaderText("ID").TextAlign(Syncfusion.Mvc.Grid.TextAlignment.Right).Width(110);
                    cols.Add(c => c.tb_Paciente.Nome_Paciente).HeaderText("Nome Paciente");
                    cols.Add(c => c.tb_Funcionario.Nome_Funcionario).HeaderText("Nome Funcionário").TextAlign(Syncfusion.Mvc.Grid.TextAlignment.Right);
                    cols.Add(c => c.tb_UBS.Nome_UBS).HeaderText("Nome UBS").TextAlign(Syncfusion.Mvc.Grid.TextAlignment.Right).Width(90);
                    cols.Add(c => c.tb_Vacina.Nome_Vacina).HeaderText("Nome Vacina").TextAlign(Syncfusion.Mvc.Grid.TextAlignment.Right).Width(80);
                    cols.Add(c => c.ID_Lote).HeaderText("Lote");
                    //cols.Add(c => c.Hora).HeaderText("Hora");
                    cols.Add(c => c.Data_Vacinacao).HeaderText("Data");
                })
             //   .ChildGrid(child =>
             //   {
             //       child.ChildGridTemplate(Html.Syncfusion().Grid<tb_Dependente>("ChildGrid_${ID_Paciente}")
             //       .Caption("Child Teste")
             //       .Column(c =>
             //       {
             //           //c.Add(p => p.ID_Dependente).HeaderText("ID Dependente").TextAlign(TextAlignment.Right);
             //           //c.Add(p => p.ID_Paciente).HeaderText("ID Paciente").TextAlign(TextAlignment.Right);
             //           c.Add(p => p.Nome_Dependente).HeaderText("Nome Dependente").TextAlign(TextAlignment.Left);
             //           c.Add(p => p.Dt_Nascimento).HeaderText("Data de Nascimento").TextAlign(TextAlignment.Left);
             //       })
             //       .AllowResizing(true)
             //       .AutoFormat(Skins.Turquoise)
             //       .Mappers(map =>
             //           {
             //           map.Action("ChildGrid", new { ID_Paciente = "${ID_Paciente}" });
             //       })
             //       .ToChildGridTemplate());
             //})
                .Render();
    }

</div>